package model.game;

import java.util.Random;

import interaction.ActionReporter;
import interaction.UserAction;



public class Game {
	
	Player user;
	Player opponent;
	ActionReporter reporter;
	UserAction action;
	
	Random random;
	
	boolean userTurn;
	boolean playing;
	
	public Game(Player user, Player opponent, ActionReporter reporter, UserAction action){
		this.user = user;
		this.opponent = opponent;
		this.reporter = reporter;
		this.action = action;
		
		user.game = this;
		opponent.game = this;
		
		random = new Random();
	}
	
	public void start(){
		playing = true;
		user.shuffleAndDraw();
		opponent.shuffleAndDraw();
		pickFirstTurn();
		loop();
	}
	
	public void pickFirstTurn(){
		//TODO let the user choose whether to go first or second
		userTurn = random.nextBoolean();
	}
	
	public void loop(){
		
	}
	
	public void end(boolean userWin){
		playing = false;
		reporter.end(userWin);
	}

}
